<include file="public:header" />
	<div class="toptip">
		<h2>提示：</h2>
		<p>你可以用HTML美化邮件内容模板。</p>
	</div>
	<div class="toptit">编辑邮件模板 <span style="color:#0033CC">{$info.name}</span></div>
	<form action="{:U('MailTemplates/edit')}" method="post"   name="form1" id="form1">
		<table width="500" border="0" cellspacing="0" cellpadding="5" style=" margin-top:6px; margin-left:15px;">
			<tr>
				<td>邮件标题模版：</td>
			</tr>
			<tr>
				<td> 
					<div id="{sitename}" class="sellabel">网站名称</div>
	            	<div id="{sitedomain}" class="sellabel">网站域名</div>
		            <volist name="info['variate']" id="variate">		
						<div id="{$key}" class="sellabel">{$variate}</div>
					</volist>		
					<div class="clear"></div>
				</td>
			</tr>
			<tr>
				<td>
					<input name="title" type="text" id="title" maxlength="150" class="input_text_400" value="{$info.title}"/>
				</td>
			</tr>
			<tr>
				<td>邮件内容模版：</td>
			</tr>
			<tr>
				<td>
					<div id="{sitename}" class="sellabel" align="left">网站名称</div>
	            	<div id="{sitedomain}" class="sellabel" align="left">网站域名</div>
		            <volist name="info['variate']" id="variate">		
						<div id="{$key}" class="sellabel" align="left">{$variate}</div>
					</volist>		
					<div class="clear"></div>
				</td>
			</tr>
			<tr>
				<td>
					<textarea name="value" id="templates_value" style="width:700px; height:260px; font-size:12px; line-height:180%" >{$info.value}</textarea>
				</td>
			</tr>
			<tr>
				<td height="80" align="center">
					<input name="id" type="hidden" value="{$info.id}" />
					<input name="save" type="submit" class="admin_submit"    value="保存修改"/>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<input name="submit22" type="button" class="admin_submit"    value="返 回" onclick="window.location='{:U('MailTemplates/index')}'"/>
				</td>
			</tr>
		</table>
	</form>
</div>
<include file="public:footer" />
<link rel="stylesheet" href="__ADMINPUBLIC__/js/jquery/kindeditor/themes/default/default.css" />
<script charset="utf-8" src="__ADMINPUBLIC__/js/jquery/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="__ADMINPUBLIC__/js/jquery/kindeditor/lang/zh_CN.js"></script>
<script type="text/javascript" src="__ADMINPUBLIC__/js/jquery.caretInsert.js"></script>
<script language="JavaScript" type="text/javascript">
	$(function(){
		var editor;
		KindEditor.ready(function(K) {
			editor = K.create('textarea[id="templates_value"]', {
				uploadJson : "?m=admin&c=upload&a=index",
				allowFileManager : true
			});
		});
		$(".sellabel").hover(function(){
			$(this).css("background-color","#ffffff");
		},function(){
			$(this).css("background-color","#F4FAFF");
		});
		$('.sellabel[align!="left"]').unbind("click").click(function(){ 
			$('#title').setCaret();
			$('#title').insertAtCaret($(this).attr("id"));
		});
		$('.sellabel[align="left"]').unbind("click").click(function(){ 
			$('#title').unbind();
			editor.insertHtml($(this).attr("id"));
		});
	});  
</script> 
</body>
</html>